/* eslint-disable prettier/prettier */
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { HydratedDocument } from 'mongoose';
import { BaseEntity } from 'src/common/schema/baseEntity.schema';

export type UserDocument = HydratedDocument<User>;

@Schema({
  collection: 'user', // 指定集合名称
  timestamps: {
    currentTime: () => Date.now(),
    createdAt: 'createTime',
    updatedAt: 'updateTime',
  },
})
export class User extends BaseEntity {
  @Prop()
  phone: string;

  @Prop()
  password: string;
}

export const UserSchema = SchemaFactory.createForClass(User);
